package com.tmptSource.controller.taglib;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.PageContext;
import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import com.tmptSource.service.intf.IA2jobService;
import org.json.JSONObject;
import com.google.gson.Gson;
import com.tmptSource.enums.*;

public class A2jobTag {

	private Logger log = Logger.getLogger(this.getClass());
	
	@Resource(name="pageContext") private PageContext pageContext;
	@Resource(name="a2jobService") private IA2jobService a2jobService;




    /**
    * 数据字典中加载数据信息
    * when column.dataResource==1,4
    * @return
    */
    public Map<String,Object> getEnumColumnSelfData(){
        Map<String,Object> mapReturn = new HashMap<String, Object>();
        Gson gson = new Gson();

        //查询条件中动态数据
        Map map = null;
        //A2jobMode
        List<Map> listA2jobModeCopy = new ArrayList<Map>();
        listA2jobModeCopy.addAll(A2jobMode.toList());
        map = new HashMap();
        map.put("keyName","");
        map.put("valueName","全部");
        map.put("optionId","");
        listA2jobModeCopy.add(0, map);
        mapReturn.put("Mode4condition",listA2jobModeCopy);
        //A2jobIsactivity
        List<Map> listA2jobIsactivityCopy = new ArrayList<Map>();
        listA2jobIsactivityCopy.addAll(A2jobIsactivity.toList());
        map = new HashMap();
        map.put("keyName","");
        map.put("valueName","全部");
        map.put("optionId","");
        listA2jobIsactivityCopy.add(0, map);
        mapReturn.put("Isactivity4condition",listA2jobIsactivityCopy);


        //添加编辑Dialog中，动态取数据（数据字典）
        String str = "";
        //A2jobMode
        str = gson.toJson(A2jobMode.toList());
        mapReturn.put("Mode4addDialog",str);
        //A2jobIsactivity
        str = gson.toJson(A2jobIsactivity.toList());
        mapReturn.put("Isactivity4addDialog",str);

        return mapReturn;
    }

}
